package com.example.administrator.bdsjws.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.administrator.bdsjws.vo.User;
import com.example.administrator.bdsjws.vo.BBX;

import com.example.administrator.bdsjws.db.UserDao;
import com.example.administrator.bdsjws.db.BBXDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userDaoConfig;
    private final DaoConfig bBXDaoConfig;

    private final UserDao userDao;
    private final BBXDao bBXDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        bBXDaoConfig = daoConfigMap.get(BBXDao.class).clone();
        bBXDaoConfig.initIdentityScope(type);

        userDao = new UserDao(userDaoConfig, this);
        bBXDao = new BBXDao(bBXDaoConfig, this);

        registerDao(User.class, userDao);
        registerDao(BBX.class, bBXDao);
    }
    
    public void clear() {
        userDaoConfig.clearIdentityScope();
        bBXDaoConfig.clearIdentityScope();
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public BBXDao getBBXDao() {
        return bBXDao;
    }

}
